<?php
session_start();
//error_reporting(E_ALL | E_STRICT);                          //错误级别
error_reporting(E_ALL);
header('Content-Type:text/html;charset=utf-8');             //文档编码
date_default_timezone_set('Asia/Shanghai');                 //设置时区
require ROOT_PATH.'/configs/profile.inc.php';               //系统配置文件
require ROOT_PATH.'/smarty/Smarty.class.php';
/**
* 自动加载类 函数
* @param string
*/
function __autoload($className) {
    if (substr($className, -10) == 'Controller') {
        require ROOT_PATH.'/controller/'.$className.'.class.php';
    } elseif (substr($className, -5) == 'Model') {
        require ROOT_PATH.'/model/'.$className.'.class.php';
    } elseif (substr($className, -5) == 'Check') {
        require ROOT_PATH.'/check/'.$className.'.class.php';
    } else {
        require ROOT_PATH.'/public/'.$className.'.class.php';
    }
}
//单入口
Factory::setController()->run(); //获取控制器的实例化对象
// $c = isset($_GET['c']) ? $_GET['c'] : 'Index';
// eval('$controller = new '.ucfirst($c).'Controller();');
// $controller->run();